<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="pub/top_list2.jsp"%>   

<%
String names = (String) request.getSession().getAttribute("name");

String sql = "select a.*,b.*,c.goodsxid,c.productid,c.sxid,c.sxname,c.sximg,d.*,e.classify from dingdan a,dingdanmx b,goodsx c,goodinfo d,shuxing e  where a.userid=? and a.orderid=b.orderid and a.state=1 and b.goodsxID=c.goodsxID and c.productid=d.productid and c.sxid=e.sxid";
String[] params = new String[1];
params[0] =names; 
List<Map<String, Object>> list = db.queryList(sql, params); 

%>


<body>
	<header class="top-header fixed-header">
		<a class="icona" href="javascript:history.go(-1)">
				<img src="images/left.png"/>
			</a>
		<h3>待付款</h3>
			<a class="iconb" href="shopcar.html">
			</a>
	</header>
	
	<div class="contaniner fixed-conta">
		<section class="order">
			<dl>
				<%
			for (Map<String, Object> m : list) {
				String ordertime=(String)m.get("ordertime");
				String title=(String)m.get("othername");
				String pic=(String)m.get("sximg");
				String fenlei=(String)m.get("classify");
				String sxname=(String)m.get("sxname");
				BigDecimal oprice=new BigDecimal(m.get("oprice").toString()).setScale(2, BigDecimal.ROUND_HALF_UP);
				int ocount=(Integer)m.get("ocount");
				BigDecimal consume=oprice.multiply(BigDecimal.valueOf(ocount));
				int orderid=(Integer)m.get("orderid");
				int state=(Integer)m.get("state");
		%>
				<dt>
					<time><%=ordertime %></time>
					<span>等待买家付款</span>
				</dt>
				<ul>
					<a href="go-order.jsp?orderid=<%=orderid %>&state=<%=state %>">
						<figure><img src="<%=pic %>" style="width:97.19px;height:97.19px;"/></figure>
						<li>
							<p><%=title %></p>
							<small><%=fenlei %>：<%=sxname %></small>						
							<b><%=oprice %></b>
							<strong>×<%=ocount %></strong>
						</li>
					</a>
				</ul>
				<dd>
					<h3>商品总额</h3>
					<i>￥<%=consume %></i>
				</dd>
				<dd>
					<input type="button" value="付款" class="order-que"/>
					
					<input type="button" value="取消订单" />
				</dd>
			<%}%>
			</dl>
		</section>
	</div>
	
	
	
	

</body>
</html>